package com.kfm.pm;

public class StudentTest {

    public static void main(String[] args) {
        Student stu1 = new Student("万叶", 89, 90, 91);
        System.out.println(stu1.sum);
        Student stu2 = new Student("魈宝", 97, 81, 81);
        Student stu3 = new Student("可莉", 90, 71, 92);
        Student stu4 = new Student("琴妈", 68, 89, 78);

        Student[] students = {stu1, stu2, stu3, stu4};
        // 按照学生的数学成绩降序排序
        // int[] arr = {};  arr[0] arr[1]
        for (int i = 0; i < students.length - 1; i++) {
            for (int j = 0; j < students.length - 1 - i; j++) {
                if (students[j].english < students[j + 1].english) {
                    Student temp = students[j];
                    students[j] = students[j + 1];
                    students[j + 1] = temp;
                }
            }
        }
        for (Student student : students) {
            System.out.println(student);
            System.out.println(student.info());
        }
    }
}
